<template>
    <div class="album-msg-box">
        <div class="title">
            <span>{{title}}</span>
            <img src="../../../../assets/main/bottem/close.png" @click="hidePlayer">
        </div>
        <div class="album">
            专辑：<button class="btn" @click="toAlbumDetail(album.id)">{{album.name}}</button>
            <div style="width: 40px"></div>
            艺术家：<button v-for="item of arts" class="btn" @click="toArtDetail(item.id)">{{item.name}}</button>
        </div>
    </div>
</template>

<script>
import {useStore} from "vuex";
export default {
    name: "albumMsg",
    props:['title','arts','album'],
    setup() {
        let store = useStore()

        function toArtDetail(id) {
            console.log('歌手id是',id)
        }

        function toAlbumDetail(id) {
            console.log('专辑id是',id)
        }

        /*
        * 隐藏播放器
        * */
        function hidePlayer() {
            store.commit('playerStore/setIsShowPlay', false)
        }

        return {
            toAlbumDetail,
            toArtDetail,
            hidePlayer
        }
    }
}
</script>

<style lang="less" scoped>
@import "../../../../style";

.album-msg-box {
    padding: 0 0 0 10px;
    width: calc(100% - 10px);
    height: 100%;
    .title {
        .inner-pos(between);
        width: 100%;
        height: 50%;
        color: white;
        span {
            .inner-pos(none);
            width: auto;
            max-width: 70%;
            height: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow:ellipsis;
            font-size: 35px;
            font-weight: bolder;
        }
        img {
            padding: 5px;
            width: 20px;
            height: 20px;
            border-radius: 5px;
            background-color: white;
        }
    }

    .album {
        width: 100%;
        height: 50%;
        display: flex;
        align-items: center;
        font-size: 20px;
        color: white;
    }
}

.btn {
    .btn-no-border;
    background-color: transparent;
    max-width: 200px;
    width: auto;
    overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
    padding: 0;
    margin: 0 20px 0 0;
    color:white;
    &:hover {
        text-decoration: underline;
    }
}
</style>